package com.henu.acmrating.service;

import com.henu.acmrating.dao.BlogMapper;
import com.henu.acmrating.pojo.Blog;
import com.henu.acmrating.pojo.BlogWithUser;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class BlogService{

    @Resource
    private BlogMapper blogMapper;

    
    public int deleteByPrimaryKey(Integer id) {
        return blogMapper.deleteByPrimaryKey(id);
    }

    
    public int insert(Blog record) {
        return blogMapper.insert(record);
    }

    
    public int insertOrUpdate(Blog record) {
        return blogMapper.insertOrUpdate(record);
    }

    
    public int insertOrUpdateSelective(Blog record) {
        return blogMapper.insertOrUpdateSelective(record);
    }

    
    public int insertSelective(Blog record) {
        return blogMapper.insertSelective(record);
    }

    
    public Blog selectByPrimaryKey(Integer id) {
        return blogMapper.selectByPrimaryKey(id);
    }

    
    public int updateByPrimaryKeySelective(Blog record) {
        return blogMapper.updateByPrimaryKeySelective(record);
    }

    
    public int updateByPrimaryKey(Blog record) {
        return blogMapper.updateByPrimaryKey(record);
    }

    
    public int updateBatch(List<Blog> list) {
        return blogMapper.updateBatch(list);
    }

    
    public int batchInsert(List<Blog> list) {
        return blogMapper.batchInsert(list);
    }

    public List<BlogWithUser> blogWithUser() {
        return blogMapper.blogWithUser();
    }

    public int updateLikeById(Integer updatedLike, Integer id) {
        return blogMapper.updateLikeById(updatedLike, id);
    }



    public List<Blog> selectByUserId(Integer userId) {
        return blogMapper.selectByUserId(userId);
    }

    public List<BlogWithUser> blogWithUserByUserId(Integer userId) {
        return blogMapper.blogWithUserByUserId(userId);
    }

    public List<Blog> selectByUserIdAndIsPublic(Integer userId) {
        return blogMapper.selectByUserIdAndIsPublic(userId);
    }

    public BlogWithUser blogWithUserOne(Integer userId, Integer id) {
        return blogMapper.blogWithUserOne(userId, id);
    }
}
